package com.zzb.dao.impl;

import com.zzb.dao.CommentDao;
import com.zzb.entity.CommentEntity;
import com.zzb.util.MyBatisUtils;

import java.util.List;

public class CommentDaoImpl implements CommentDao {
    @Override
    public CommentEntity findByName(CommentEntity commentEntity) {
        CommentDao commentDao = MyBatisUtils.getMapper(CommentDao.class);
        return commentDao.findByName(commentEntity);
    }

    @Override
    public int add(CommentEntity commentEntity) {
        CommentDao commentDao = MyBatisUtils.getMapper(CommentDao.class);
        return commentDao.add(commentEntity);
    }

    @Override
    public int delete(CommentEntity commentEntity) {
        CommentDao commentDao = MyBatisUtils.getMapper(CommentDao.class);
        return commentDao.delete(commentEntity);
    }

    @Override
    public CommentEntity findById(CommentEntity commentEntity) {
        CommentDao commentDao = MyBatisUtils.getMapper(CommentDao.class);
        return commentDao.findById(commentEntity);
    }

    @Override
    public List<CommentEntity> findAll(CommentEntity commentEntity) {
        CommentDao commentDao = MyBatisUtils.getMapper(CommentDao.class);
        return commentDao.findAll(commentEntity);
    }

    @Override
    public int update(CommentEntity commentEntity) {
        CommentDao commentDao = MyBatisUtils.getMapper(CommentDao.class);
        return commentDao.update(commentEntity);
    }

    @Override
    public int count(CommentEntity commentEntity) {
        CommentDao commentDao = MyBatisUtils.getMapper(CommentDao.class);
        return commentDao.count(commentEntity);
    }
}
